package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;

import java.io.IOException;

/**
 * 启动程序
 *
 * @author ruoyi
 */
// @ComponentScan(basePackages = {"com.ruoyi.web.core.config","com.ruoyi.web"})
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class RuoYiApplication
{
    public static void main(String[] args)
    {
        // 快捷方式路径列表
        String[] shortcuts = {
                // "F:\\e\\Desktop\\nginx.exe - 快捷方式.lnk",
                "F:\\e\\Desktop\\redis-server.exe - 快捷方式.lnk" //TODO:redis.exe位置（加了这个可以一键启动后端，需要修改）
        };
        // 依次执行每个快捷方式
        for (String shortcutPath : shortcuts) {
            try {
                ProcessBuilder processBuilder = new ProcessBuilder("cmd", "/c", "start", "\"\"", shortcutPath);
                Process process = processBuilder.start();
                process.waitFor(); // 等待当前快捷方式执行完成
            } catch (IOException | InterruptedException e) {
                e.printStackTrace();
            }
        }
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(RuoYiApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  创客实验室门户启动！！！   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
    }
}
